@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/open62541Targets.cmake")

set (open62541_TOOLS_DIR @PACKAGE_open62541_install_tools_dir@ CACHE PATH "Path to the directory that contains the tooling of the stack")
set (UA_NODESET_DIR @PACKAGE_open62541_install_nodeset_dir@ CACHE PATH "Path to the directory that contains the OPC UA schema repository")

include(CMakeFindDependencyMacro)
find_dependency(PythonInterp 3 REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/open62541Macros.cmake")

set(open62541_COMPONENTS_ALL @open62541_enabled_components@)

# find_dependency has no option to provide hints for modules, so temporary add the path to CMAKE_MODULE_PATH
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list (FIND open62541_COMPONENTS_ALL "EncryptionMbedTLS" _index)
if((${_index} GREATER 0) OR (${_index} EQUAL 0))
    find_dependency(MbedTLS REQUIRED)
endif()

list(REMOVE_AT CMAKE_MODULE_PATH -1)

foreach(_comp ${open62541_FIND_COMPONENTS})
  list (FIND open62541_COMPONENTS_ALL "${_comp}" _index)
  if (${_index} LESS 0)
    set(open62541_FOUND False)
    set(open62541_NOTFOUND_MESSAGE "Unsupported open62541 component: ${_comp}")
    message(WARNING "${open62541_NOTFOUND_MESSAGE}")
  endif()
endforeach()
